<?php
	
	if(!defined("IN_APP"))
	{
		exit;
	}
	
	if(!adminpermission('Z','Z100001'))
	{
		echo '无权查看!';
		exit;
	}
	
	
	
	$method = getParam('m','get','list');
	
	$parm = requestArrayParm($_REQUEST);
	
	if($method == 'list')
	{
		$typearr['name'] = '登录帐号';
		$typearr['phone'] = '手机号';
		
		$fTitle = "帐号管理";
		$sTitle = "帐号列表";
		
		$search = array();
		
		$page = $pages['page'] = getParam('page','request','1');
		
		$pages['rows'] = 20;
		
		$resData = _Admin::getAdminList($search, $pages, $between,$sort);
		
		//查询对应的数据
		
		foreach ($resData['list']  as $key => $value)
		{
			$value['quanxian'] = json_decode($value['permission'],true);
			$list[] = $value;
		}
		
		$pageurl = SITE_URL.'admin.php?'.set_URL_Param(get_URL_Param());
	
		$pagetotal = $resData["pages"];
		
		include renderTemplate('admin/passport/list');
	}
	
	if($method == 'addZH')
	{
		unset($sysMenuList['Z']);
		$list = $sysMenuList;
		$pagetitle = '添加帐号信息';
		include renderTemplate('admin/passport/info');
	}
	
	if($method == 'editZH')
	{
		$pagetitle = '修改帐号信息';
		
		if($parm['id'])
		{
			unset($where,$data);
			$where['id'] = $parm['id'];
			$admin = _Admin::getAdminInfo($where);
			if($admin)
			{
				unset($sysMenuList['Z']);
				$list = $sysMenuList;
				
				$admin['permission'] = json_decode($admin['permission'],true);
			}
			else
			{
				header("Location:".SITE_URL.'admin.php?a=adminM');
			}
		}
		else
		{
			header("Location:".SITE_URL.'admin.php?a=adminM');
		}
		include renderTemplate('admin/passport/info');
	}
	
	